//
//  JBWComposeButton.swift
//  新浪微博
//
//  Created by 季伯文 on 2017/7/7.
//  Copyright © 2017年 bowen. All rights reserved.
//

import UIKit

class JBWComposeButton: UIButton {

    //方便使用属性
    var composeModel: JBWComposeModel?
    //去掉六个高亮效果
    override var isHighlighted: Bool {
        get{
            return false
        }
        set {
            //空实现
        }
    }
    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    //设置视图
    private func setupUI(){
        imageView?.contentMode = .center
        titleLabel?.textAlignment = .center
        titleLabel?.font = UIFont.systemFont(ofSize: JBWNormalFontSize)
        setTitleColor(UIColor.darkGray, for: UIControlState.normal)
    }
    
    //重写layoutSubviews
    override func layoutSubviews() {
        super.layoutSubviews()
        //imageView
        imageView?.frame = CGRect(x: 0, y: 0, width: self.frame.width, height: self.frame.width )
        //titleLabel
        titleLabel?.frame = CGRect(x: 0, y: self.frame.width, width: self.frame.width, height: self.frame.height - self.frame.width)

    }

}
